package com.qd.common.panda.domain.entity.transfer;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 租赁关系
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserTransferRelationDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "关系ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "关系ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String rid;
    /**
     * 金额
     */
    @NotNull(message = "金额不能为空", groups = DefaultGroup.class)
    private BigDecimal amount;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 转账ID
     */
    @NotBlank(message = "转账ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "转账ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String tid;
    /**
     * 租赁ID
     */
    @NotBlank(message = "租赁ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "租赁ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String sid;
    /**
     * 用户ID
     */
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;

    @Override
    public void freeData() {
        this.rid = null;
        this.amount = null;
        this.addTime = null;
        this.tid = null;
        this.sid = null;
        this.userId = null;
        super.freeData();
    }
}
